sync: from linuxdeepin/dtkdeclarative#323
Conversation
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#549
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepin-ci-robot The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideSynchronized dtkdeclarative sources by replacing the compile-time CHAMELEON_PATH define in example apps with a runtime-computed path, removed obsolete CHAMELEON_PATH macros from CMake, and streamlined qt6 plugin installation to only deploy the qmldir file. Class diagram for main.cpp changes in example appsclassDiagram
class QQmlApplicationEngine {
+addImportPath(path: QString)
}
class QQuickStyle {
+addStylePath(path: QString)
+setStyle(style: QString)
}
class QGuiApplication {
+applicationDirPath(): QString
}
class main {
+chameleonPath: QString
+engine: QQmlApplicationEngine
+setupStylePaths()
}
main --> QQmlApplicationEngine
main --> QQuickStyle
main --> QGuiApplication
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `examples/exhibition/main.cpp:84` </location>
<code_context>
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) && defined(QT_NO_DEBUG)
- QQuickStyle::setStyle(CHAMELEON_PATH"/Chameleon");
+ QQuickStyle::setStyle(chameleonPath"/Chameleon");
#else
QQuickStyle::setStyle("Chameleon");
</code_context>
<issue_to_address>
**issue (bug_risk):** String concatenation with chameleonPath may not behave as expected.
Use chameleonPath + "/Chameleon" for proper string concatenation in C++.
</issue_to_address>
### Comment 2
<location> `examples/qml-inspect/main.cpp:33` </location>
<code_context>
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) && defined(QT_NO_DEBUG)
- QQuickStyle::setStyle(CHAMELEON_PATH"/Chameleon");
+ QQuickStyle::setStyle(chameleonPath"/Chameleon");
#else
QQuickStyle::setStyle("Chameleon");
</code_context>
<issue_to_address>
**issue (bug_risk):** String concatenation with chameleonPath may not behave as expected.
Use chameleonPath + "/Chameleon" for proper string concatenation in C++.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
|
||
| #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) && defined(QT_NO_DEBUG) | ||
| QQuickStyle::setStyle(CHAMELEON_PATH"/Chameleon"); | ||
| QQuickStyle::setStyle(chameleonPath"/Chameleon"); |
There was a problem hiding this comment.
issue (bug_risk): String concatenation with chameleonPath may not behave as expected.
Use chameleonPath + "/Chameleon" for proper string concatenation in C++.
|
|
||
| #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) && defined(QT_NO_DEBUG) | ||
| QQuickStyle::setStyle(CHAMELEON_PATH"/Chameleon"); | ||
| QQuickStyle::setStyle(chameleonPath"/Chameleon"); |
There was a problem hiding this comment.
issue (bug_risk): String concatenation with chameleonPath may not behave as expected.
Use chameleonPath + "/Chameleon" for proper string concatenation in C++.
deepin pr auto review我来对这个git diff进行代码审查:
-set(CHAMELEON_PATH "${PROJECT_BINARY_DIR}/plugins")
add_definitions(
- -DCHAMELEON_PATH="${CHAMELEON_PATH}"
-DQT_DEPRECATED_WARNINGS
)修改评价:
- engine.addImportPath(CHAMELEON_PATH);
+ const QString chameleonPath = QStringLiteral("%1/../../../plugins").arg(QGuiApplication::applicationDirPath());
+ engine.addImportPath(chameleonPath);评价:
-install(DIRECTORY "${PLUGIN_OUTPUT_DIR}/${URI_PATH}/" DESTINATION "${QML_INSTALL_DIR}/${URI_PATH}")
+install(FILES "${PLUGIN_OUTPUT_DIR}/${URI_PATH}/qmldir" DESTINATION "${QML_INSTALL_DIR}/${URI_PATH}")评价:
总体建议:
这些修改整体上是积极的,但在实际使用中建议添加更多的错误处理和安全检查。 |
Synchronize source files from linuxdeepin/dtkdeclarative.
Source-pull-request: linuxdeepin/dtkdeclarative#549
Summary by Sourcery
Synchronize changes from linuxdeepin/dtkdeclarative to improve example applications and streamline build/install scripts.
Enhancements:
Build: